import * as React from 'react';
import { StyleSheet, Text, View, TextInput, Button, Image, } from 'react-native';

interface ITopCardProps {
  dataSource: {
    icon: '',
    title: '',
    desc: ''
  }
}
class TopCard extends React.Component<ITopCardProps> {
  render() {
    const data = this.props.dataSource || 
    {
      icon: 'http://120.48.109.211:8088/static/icon/money.png',
      title: '嗨, 欢迎回来',
      desc: '登录之后更精彩, 美好体验即将开始'
    }
    return (
      <View style={styles.container}>
        <Image resizeMode='contain' style={styles.logo} source={{ uri: data.icon }}></Image>
        <Text style={styles.saiHi}>{data.title}</Text>
        <Text style={styles.saiHiDesc}>{data.desc}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    marginLeft: 15,
    marginTop: 20,
  },
  logo: {
    width: 45,
    height: 45,
   },
  saiHi: {
   fontSize: 24,
   color: '#212121',
   marginTop: 15,
  },
  saiHiDesc: {
    fontSize: 15,
    color: '#999999',
    marginTop: 10,
  },
});

export default TopCard